<%- missing_plugin = "missing_plugin" if scope[:tvm].instance_of? com.thoughtworks.go.presentation.MissingPluggableTaskViewModel %>

<tr class="task_<%= scope[:task_config_index] %> <%= missing_plugin -%>">
  <% unless @is_config_repo_pipeline %>
    <td>
        <% unless scope[:task_config_index] == 0 %>
            <%= form_tag(admin_task_decrement_index_path(:task_index => scope[:task_config_index]), :method => :POST) %>
            <%= md5_field %>
            <button type="submit" value="" class="promote_button" title="Move Up">
                <div class="promote_up"></div>
            </button>
            <%= end_form_tag %>
        <% end %>
        <% unless scope[:task_config_index] == @tasks.size() - 1 %>
            <%= form_tag(admin_task_increment_index_path(:task_index => scope[:task_config_index]), :method => :POST) %>
            <%= md5_field %>
            <button type="submit" value="" class="promote_button" title="Move Down">
                <div class="promote_down"></div>
            </button>
            <%= end_form_tag %>
        <% end %>
    </td>
  <% end %>
    <%- js_frag = "Util.ajax_modal('#{admin_task_edit_path(:task_index => scope[:task_config_index], :type => scope[:tvm].getTaskType())}', {readOnly: #{@is_config_repo_pipeline || false}, overlayClose: false, title: 'Edit #{scope[:tvm].getTypeForDisplay()} task'}, function(text){return text}, true)" -%>
    <%== render_pluggable_template(scope[:tvm], { :scope => scope, :modify_onclick_callback => js_frag}) -%>
  <% unless @is_config_repo_pipeline %>
    <td class="">
        <%= form_tag admin_task_delete_path(:task_index => scope[:task_config_index]), {:method => :delete, :id => "delete_task_#{scope[:task_config_index]}"} %>
        <%= md5_field %>
        <span class="icon_remove delete_parent" id="trigger_delete_task_<%= scope[:task_config_index] %>">
            <%= render :partial => 'admin/shared/submit_with_prompt.html', :locals => {:scope => {:button_id => "trigger_delete_task_#{scope[:task_config_index]}", :message => "Are you sure you want to delete the task at index '#{scope[:task_config_index] + 1}' ? ", :on_confirmation_js => "$('#{"delete_task_#{scope[:task_config_index]}"}').submit()"}} %>
        </span>
        <%= end_form_tag -%>
    </td>
  <% end %>
</tr>
